#include <bits/stdc++.h>
using namespace std;


const int N = 2e4+5;

vector<int> G[N];

namespace tarjan {

int cnt, dfn[N], low[N];
int ans = 0;
bool arc[N];

void init(int n)
{
    ans = 0;
    cnt = 0;
    memset(dfn+1, 0, sizeof(int) * n);
    memset(arc+1, 0, sizeof(bool) * n);
}

void tarjan(int u, int fa)
{
    dfn[u] = low[u] = ++cnt;
    int x = 0;
    for (int v : G[u])
    {
        if (v == fa) continue;
        if (!dfn[v])
        {
            tarjan(v, u);
            x += low[v] >= dfn[u];
            low[u] = min(low[u], low[v]);
        } else if (dfn[u] > dfn[v]) low[u] = min(low[u], dfn[v]);
    }
    arc[u] = (x - (fa == -1)) > 0;
}


int go(int n)
{
    init(n);
    for (int i=1; i<=n; ++i) {
        cnt = 0;
        if (!dfn[i]) tarjan(i, -1);
    }
        
    for (int i=1; i<=n; ++i)
        ans += arc[i];
    return ans;
}

}

int n, m;

int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for (int i=0; i<m; ++i)
    {
        int u, v;
        scanf("%d%d", &u, &v);
        G[u].push_back(v);
        G[v].push_back(u);
    }   
    printf("%d\n", tarjan::go(n));
    vector<int> ans;
    for (int i=1; i<=n;++i)
        if (tarjan::arc[i])
            ans.push_back(i);

    // for (int i=1; i<=n; ++i)
    //     printf("i=%d, dfn=%d, low=%d\n", i, tarjan::dfn[i], tarjan::low[i]);
    
    for (int i=0; i<(int)ans.size(); ++i)
    {
        printf("%d%c", ans[i], i==ans.size()-1? '\n':' ');
    }
    return 0;
}
